package com.hs.core.dwr;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;

import com.hs.core.action.BaseAction;
import com.hs.core.db.DBMgr;

public abstract class DwrHelper extends BaseAction{
	/**
	 * 获得request
	 * @return
	 */
	public HttpServletRequest getHttpServletRequest(){
		WebContext ctx = WebContextFactory.get();   
		return ctx.getHttpServletRequest();   
	}
	/**
	 * 获得session
	 * @return
	 */
	public HttpSession getHttpSession(){
		WebContext ctx = WebContextFactory.get();   
		return ctx.getSession();   
	}
	/**
	 * 
	 * @return
	 */
	public DBMgr getDbo(){
		DBMgr dbo = DBMgr.getDbUtilInst(getHttpSession().getServletContext());
		return dbo;
	} 
	 
}
